package com.xuecheng.system.controller;


import com.xuecheng.api.system.CourseCategoryApi;
import com.xuecheng.api.system.model.dto.CourseCategoryDTO;
import com.xuecheng.common.domain.response.RestResponse;
import com.xuecheng.system.service.CourseCategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;


@RestController
public class CourseCategoryController implements CourseCategoryApi {


    @Autowired
    private CourseCategoryService courseCategoryService;


    @GetMapping("/course-category/tree-nodes")
    public List<CourseCategoryDTO> queryCourseCategory() {

        //调用service

        return courseCategoryService.queryThreeNodes();
    }

    @GetMapping("/l/course-category/{id}")
    public RestResponse<CourseCategoryDTO> queryCourseCategoryById(@PathVariable String id) {

        return courseCategoryService.queryCourseCategoryById(id);
    }
}
